use pnet::datalink::interfaces;
use std::net::IpAddr;
/* ---------------------------------------------------------------- 获取用户终端 ip -- */
pub fn ip() -> Option<IpAddr> {
    let interfaces_res = interfaces();
    
    for v in interfaces_res {
        for ip in v.ips {
            if ip.is_ipv4() {
                return Some(ip.ip());
            }
        }
    }
    None
}